UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OKeCPRwd+3m4dOa8dyidIyinNes6MfuVCKrJ6CBbUuo='
WHERE
key_id = 'a2a832d4d3f282f42c78d548d09de1fc6ff01d4359a0b8dd63d1ba00d98ab2e5'
AND (
token = 'OKeCPRwd+3m4dOa8dyidIyinNes6MfuVCKrJ6CBbUuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)