UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nQ76CP3u2Bly26nTl4BgJpfHGcAq60pxvhcyxcsvtEE=' 
WHERE 
  key_id = '89e2362477089c40fe57a08653aab4f43aea26ad7cdeac2b5723fa96da68b01a' 
  AND (
    token = 'nQ76CP3u2Bly26nTl4BgJpfHGcAq60pxvhcyxcsvtEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048