UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ol8RUiBjFpxVH/3+DNnvFunWrzrMXcZVe2xwPt4gaak='
WHERE
key_id = '26c278d68424f0e357f8b544e9ca8b4bb25cbdff9d9f140dbce328d142a5da7b'
AND (
token = 'Ol8RUiBjFpxVH/3+DNnvFunWrzrMXcZVe2xwPt4gaak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)