UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w7LT8KxF4jNCEGahGRJ2p9kM4vRkjljMkP7SyL3OoyA='
WHERE
key_id = '3abe72e7f8c4847e2d54b2a138734ccba309ccd667a51e2e8e3f01ecc8e8ed69'
AND (
token = 'w7LT8KxF4jNCEGahGRJ2p9kM4vRkjljMkP7SyL3OoyA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)