UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0sES/N69nmw5Wu3qXFwpjISt29qn1d09wQY4BLTUXcs='
WHERE
key_id = 'e3bd701bc01a93b5893f4d9f19f09549fea693f245ff7a4c80c612d86c028808'
AND (
token = '0sES/N69nmw5Wu3qXFwpjISt29qn1d09wQY4BLTUXcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)