UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Aw/Yti4MI95WlxQDoU9n6YeJ6/ep9L/ONV1XKdMTy4w='
WHERE
key_id = '214c7835666f6bdc1bb0ab31c9ec2016c7e6be0975b69fe0c9ce78936afbfe77'
AND (
token = 'Aw/Yti4MI95WlxQDoU9n6YeJ6/ep9L/ONV1XKdMTy4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)