UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '95YP1B9+InR72m2ZIxQ2LdiR8sPMgT4UJuEdPv26Ek4='
WHERE
key_id = 'f7853b7dc50423ab1849f1f02f2c9b5cb003f39afaac4795307375f35ea6c0f8'
AND (
token = '95YP1B9+InR72m2ZIxQ2LdiR8sPMgT4UJuEdPv26Ek4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)