UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tZlg8u1dVEXto/jtxBVEhXbTrizkpYkZxds97DQBnCw='
WHERE
key_id = 'de2709d3e05c9fc1c85214fd0dabc16bc18ce8eaa0100bb5be406b591a1ba5a3'
AND (
token = 'tZlg8u1dVEXto/jtxBVEhXbTrizkpYkZxds97DQBnCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)