UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tRgUz8fPZDc5LpNg9N8ERgZnKaTImQB13tLLMZrHWvQ='
WHERE
key_id = '548818c031e24e09102ae66bf39a69ca02697006b0a8f7d9d2ccffd05e572226'
AND (
token = 'tRgUz8fPZDc5LpNg9N8ERgZnKaTImQB13tLLMZrHWvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)