UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yEB7vAbs1q8e7i/3MsAzjDcEZG1GIOAsEciSgGSqu3k=' 
WHERE 
  key_id = 'c69543aa61e384f85199676269ce5dc7e517c9377e671b519d3c7b9b20bf9a03' 
  AND (
    token = 'yEB7vAbs1q8e7i/3MsAzjDcEZG1GIOAsEciSgGSqu3k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050