UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OPsFyNCiFxgr605WdvjrjvRnuJvw9K6ONKDVd/pi2jg='
WHERE
key_id = '4d6fc992a2214be95c14ea915a482d97470fd222aa8f038d55c21cd14fec89dc'
AND (
token = 'OPsFyNCiFxgr605WdvjrjvRnuJvw9K6ONKDVd/pi2jg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)