UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2R5oTOYNdYthUQNZoEdY1zmoj3+GtdYg/SYN6diKM9A=' 
WHERE 
  key_id = 'c41fd2132a7b4a6e2e0afc6dcf41445a6d2cb10e05748cfa16e30aafc5e56439' 
  AND (
    token = '2R5oTOYNdYthUQNZoEdY1zmoj3+GtdYg/SYN6diKM9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042