UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ROW6mec9yhqi3arEZCqljcV+1xzIzxGb1gTV/a1XHVE=' 
WHERE 
  key_id = '9d5daa3268326f37178dfdef2d7d233c2e06a618b26d4da7a5483e75bc026e24' 
  AND (
    token = 'ROW6mec9yhqi3arEZCqljcV+1xzIzxGb1gTV/a1XHVE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018