UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Rcal2ro69X99itVdBQB5pLzBZXcW+8ZelVEXceH+eo=' 
WHERE 
  key_id = '10c45668869976946f6f348bb86739918cde48db91d58cb8f410146b2a8a39f3' 
  AND (
    token = '/Rcal2ro69X99itVdBQB5pLzBZXcW+8ZelVEXceH+eo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030