UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G2nThqJy+1zSRvzbsNeAiiTjdQGds3weoN3GTyrLsA0=' 
WHERE 
  key_id = '93cfd938ec1d9c4ef5fac837f5ea59cf0470c559626af2689f3be49c277d3aa5' 
  AND (
    token = 'G2nThqJy+1zSRvzbsNeAiiTjdQGds3weoN3GTyrLsA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024