UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I6VR6SoWBdWOhl3lI3loUJUFnKGXkdkiXus8X9XVfq4='
WHERE
key_id = '35524f56073fd22250d88ee54a17681e2e0893fcfc3875b73545f0361de90296'
AND (
token = 'I6VR6SoWBdWOhl3lI3loUJUFnKGXkdkiXus8X9XVfq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)