UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LhwvZoHfjZztzV3ctC7d/Ln7TvdDApNuF9J72tZQ6M8=' 
WHERE 
  key_id = '8879b5a7cf18eed6fa5332ea495a6d73f09629477e5ea8e37a97178cfac5bd09' 
  AND (
    token = 'LhwvZoHfjZztzV3ctC7d/Ln7TvdDApNuF9J72tZQ6M8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025