UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VBPTtXIAl+/fxxhVUIUISLaH5OvYm1s9fLHLXAsE3N0='
WHERE
key_id = '94c1522a67d0e1777c39600186c18d6cab26da40c6036c348f92499e65609ff4'
AND (
token = 'VBPTtXIAl+/fxxhVUIUISLaH5OvYm1s9fLHLXAsE3N0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)