UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eLXvYut2yn5XqGp8yexBAhbpD6XyRLIl90sRu3AmDG4='
WHERE
key_id = '819725e19c22ae2edb59f3b77bd38bb4445615baa180a6825f49be43bd9816bf'
AND (
token = 'eLXvYut2yn5XqGp8yexBAhbpD6XyRLIl90sRu3AmDG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)