UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+6McQ9j+8B6iX1KpB3ck3O7G6Irop5pmLer5PedhJUA='
WHERE
key_id = '26c9ff13763362fb1ad2b5901bf1420aaf1670346ff897277a1add25e7c50290'
AND (
token = '+6McQ9j+8B6iX1KpB3ck3O7G6Irop5pmLer5PedhJUA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)