UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xROUgCiGOfMkUpkNOccAmnLG4UiOl7K+hdc0nRwRtnA='
WHERE
key_id = 'c8788fb2208d2eee4cb82103a48a69bbc53fcdc39d917abfa7f538c6f6e08804'
AND (
token = 'xROUgCiGOfMkUpkNOccAmnLG4UiOl7K+hdc0nRwRtnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)