UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P4trxsDlq9yuSkBzHRV6iPX5SvbGs5L9xsHHX69s3bk='
WHERE
key_id = '53900e8c95628d5c7ccda82a23b3e27a7bcc6e214c07a6204a501e0f49ee5c3a'
AND (
token = 'P4trxsDlq9yuSkBzHRV6iPX5SvbGs5L9xsHHX69s3bk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)