UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2UfeNdlivUNGaYMeKO6klrSQuSCxDdXFJxdsTMXGNcc='
WHERE
key_id = 'e591e5ffe7e53d5756e2b8b1c7c513133a539838a0f07f5ac2e028feacecb547'
AND (
token = '2UfeNdlivUNGaYMeKO6klrSQuSCxDdXFJxdsTMXGNcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)