UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qIPN4CARolrlnY3+9iKgM+aTIcsSo41TDftESbSPHLw='
WHERE
key_id = '1af65a0e523e03588a2bdfb81850b1dfae0f66b0a385a82e6525d4e14883aa33'
AND (
token = 'qIPN4CARolrlnY3+9iKgM+aTIcsSo41TDftESbSPHLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)