UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mhI6a0pD7lKp/WNbjXNgP4uNnd/algIxjI0zIjfgZ/8=' 
WHERE 
  key_id = '2ba66de5dcb441ad3f51323ced9e61bf8c10606562bfa272e86b4752dba3d441' 
  AND (
    token = 'mhI6a0pD7lKp/WNbjXNgP4uNnd/algIxjI0zIjfgZ/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050