UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B2ygX3SB5v9eC1zciCR9lSxqHziO4FJ6h9KU+aFQP1k='
WHERE
key_id = '2dabdbd2fa9866716377e23c894ec17417cf9f4745be81a31f79a8c03380bc16'
AND (
token = 'B2ygX3SB5v9eC1zciCR9lSxqHziO4FJ6h9KU+aFQP1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)