UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zg1x4CgCuf/OOHm1fAy7iEZt9Vo2yIO4l7hYr+NsegA='
WHERE
key_id = '155da12c0d384633a2531e381cda3f75d61cecd5851898a0f40970ba0397a4e4'
AND (
token = 'zg1x4CgCuf/OOHm1fAy7iEZt9Vo2yIO4l7hYr+NsegA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)