UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '58FEgSFnB/nJXTjjYUqBmocqnEUmdh7tIEKtIgo/zW4=' 
WHERE 
  key_id = '5e7c93de988217ffcfdfee48a88ba97ae2b9791aa6a879d9187b1bc5e34f2a19' 
  AND (
    token = '58FEgSFnB/nJXTjjYUqBmocqnEUmdh7tIEKtIgo/zW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036