UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/RBZrvkzXiAeOuDxuxPIZ1EK355VSrJ0o+LuHRZS/Vg='
WHERE
key_id = 'bad08cb0ce77d813203e28af5a7b21089848f82bd9be944b82491cd911ed268f'
AND (
token = '/RBZrvkzXiAeOuDxuxPIZ1EK355VSrJ0o+LuHRZS/Vg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)