UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4SGfOwrSuSPXC0FRcdGlfzEz/5JnDSPgvIxH2w1mcFM=' 
WHERE 
  key_id = '4465921e442257441b6620cca762563199d26c57f82eef0414a1d92d2427f1b6' 
  AND (
    token = '4SGfOwrSuSPXC0FRcdGlfzEz/5JnDSPgvIxH2w1mcFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030