UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '28dU4+ujgT7ogI1J9jDzbdguYQpS9WFUCBSVExgP9fk=' 
WHERE 
  key_id = '052063bba87069231319b19a811395675ff2a3434af9e200a5a1bd7ce17ad688' 
  AND (
    token = '28dU4+ujgT7ogI1J9jDzbdguYQpS9WFUCBSVExgP9fk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030