UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '25VVUA1v75B8HLl7tnicBSh5+j9SPCLeSbtF+tCUI60=' 
WHERE 
  key_id = '2bcf4cf73e0d81a668f7f18d3d853153dc35cb5b4084536a3febecb2d1291a31' 
  AND (
    token = '25VVUA1v75B8HLl7tnicBSh5+j9SPCLeSbtF+tCUI60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052