UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9VBTZv6vqnN8i4yCgg64wZ70tdEjrrMSC/KeZ7t9wsI='
WHERE
key_id = '6844819fe6ea9ef61e4e02c34f37da55abc702e784ad633441ef0d6162e0f8a6'
AND (
token = '9VBTZv6vqnN8i4yCgg64wZ70tdEjrrMSC/KeZ7t9wsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)