UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RIM3HDnM4sfE19SSsjaH9I+mBjBd1FjOUeMtH70XGXc='
WHERE
key_id = 'd803efdf78e76672657f7975dea4691b61e0e58a4fd8a1294ddd6ce85fe63c65'
AND (
token = 'RIM3HDnM4sfE19SSsjaH9I+mBjBd1FjOUeMtH70XGXc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)