UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+fLZTcKduCCadjSPcwyrogvuKLWIQkrq7EbBCzlHgB0=' 
WHERE 
  key_id = '9ed5b92ef449601c944b7b4c92cf94e8b66e14e50aeae3a27585040af6e0341b' 
  AND (
    token = '+fLZTcKduCCadjSPcwyrogvuKLWIQkrq7EbBCzlHgB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021