UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uZ/jkfF1GUt+KWtz/Z9sqvis5ZoNQ2nEohb7TV6C4iE=' 
WHERE 
  key_id = '9237c23b1aeb8357a194646e2c4ef11942edb63e5bc51b698c10f877ab66d904' 
  AND (
    token = 'uZ/jkfF1GUt+KWtz/Z9sqvis5ZoNQ2nEohb7TV6C4iE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032