UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z/v31OisrPieHQs0K/MdFpSglr4yQF8CufGYOCCZ5rc='
WHERE
key_id = '229c054532ca684f1e0693391f9b32c4bbef4727cc3b1933f080e0766d55ecf4'
AND (
token = 'z/v31OisrPieHQs0K/MdFpSglr4yQF8CufGYOCCZ5rc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)