UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VRhHwpG7VKa3v7TX7mxYIotmFz6puRMf/feXEuqY0Aw=' 
WHERE 
  key_id = 'af0ab10d6f74373e0cc0ede44183127d04cb680ad0c15da3c545718e81585ede' 
  AND (
    token = 'VRhHwpG7VKa3v7TX7mxYIotmFz6puRMf/feXEuqY0Aw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037