UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5uqLyAnAf48XNyT5D5eElswIRaJ0UIIwYgcAh4NQaOE=' 
WHERE 
  key_id = '688a0bdc999a4abea9df998b27fc9ee3a8facaf97f779c801a5de92b4dc6f66b' 
  AND (
    token = '5uqLyAnAf48XNyT5D5eElswIRaJ0UIIwYgcAh4NQaOE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041