UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1cqU1BCpFJ+/pItptVXzPc1rPQS7Cd/g1M7zvFk1/eQ='
WHERE
key_id = '37f0205cc2b62bef208a3c22f0702ab38ba39ee54b09486aa0a6ff4dca1117df'
AND (
token = '1cqU1BCpFJ+/pItptVXzPc1rPQS7Cd/g1M7zvFk1/eQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)