UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KyFsVSwJ+gqkY5TQD69ngrQgix8qF6ynG0vbcrWH+T4='
WHERE
key_id = '4b2ccf0ce732be5c93ae656c13fabc91f792aa09bc816574738977c89381248d'
AND (
token = 'KyFsVSwJ+gqkY5TQD69ngrQgix8qF6ynG0vbcrWH+T4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)