UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mxONBc4hbXEssn5hkqJ/NfFQfdY6y77yrOGmPAI8tw4='
WHERE
key_id = '0b7081d78b3929111b6b6986780b6cacb76c1bd1e026928c29831085fa0a150e'
AND (
token = 'mxONBc4hbXEssn5hkqJ/NfFQfdY6y77yrOGmPAI8tw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)